import React, { Component } from 'react'

// 反向继承,可以用它机制对原来的render渲染时行劫持后处理
const withLayout = Cmp => {
  return class Layout extends Cmp {
    render() {
      return (
        <>
          <h3>顶部导航</h3>
          <Cmp {...this.props} />
          <footer>底部声明</footer>
        </>
      )
    }
  }
}

export default withLayout
